import 'package:json_annotation/json_annotation.dart';
part 'room_item.g.dart';

@JsonSerializable()
// 房源类
class RoomItem {
  @JsonKey(name: 'houseCode')
  final String id; // 房屋id
  final String title; // 标题
  final String desc; // 房屋描述
  final String houseImg; // 房屋照片
  final List<String> tags; // 房屋标签标签列表
  final int price; // 出租价格

  const RoomItem({
    this.id = "",
    this.title = "",
    this.desc = "",
    this.houseImg = "",
    this.tags = const [],
    this.price = 0,
  });

  factory RoomItem.fromJson(Map<String, dynamic> json)=>_$RoomItemFromJson(json);
  Map<String, dynamic> toJson()=>_$RoomItemToJson(this);
}